package home.projects.misc;

import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TrioTest {
   
   public static void main(final String[] args) {
      String s = "[2H, 4C, KC, 5D] $10 [QS, QD] $5 [AC, 3C, 4D] $25 [10H, 5C, 7H]";
      Pattern pat = Pattern.compile("[$,\\[\\]]");
      System.out.println(pat);
      Matcher mat = pat.matcher(s);
      String newS = mat.replaceAll("");
      System.out.println("Old S: " + s + "\nNew S: " + newS);
      
      SortedTrio<Child> st = new SortedTrio<Child>();
   }

}

class Trio<T> {

   protected T first, second, third;

   public Trio() {
      super();
   }
   
   public Trio(T first, T second, T third) {
      this.first = first;
      this.second = second;
      this.third = third;
   }
   
   public T getFirst() {
      return first;
   }

   public void setFirst(T first) {
      this.first = first;
   }

   public T getSecond() {
      return second;
   }

   public void setSecond(T second) {
      this.second = second;
   }

   public T getThird() {
      return third;
   }

   public void setThird(T third) {
      this.third = third;
   }

   @Override
   public String toString() {
      return "<First: " + first + " Second: " + second + " Third: " + third
            + ">";
   }

}

class SortedTrio<T extends Comparable<? super T>> extends Trio<T> {

   protected List<T> sortedTrio;
   
   public SortedTrio() {
      super();
   }
   
   public SortedTrio(T first, T second, T third) {
      super(first, second, third);
      sortedTrio.add(first);
      sortedTrio.add(second);
      sortedTrio.add(third);
   }
   
   
}

class Base implements Comparable<Base> {
   
   private int i;
   
   public int compareTo(Base o) {
      return this.i - o.i;
   }
   
}

class Child extends Base {  
}